package logicGame.States;

import java.io.Serializable;
import java.util.ArrayList;
import javax.swing.JTextField;
import logicGame.*;
import logicGame.Cards.Card;

public abstract class StateAdapter implements State, Serializable {

    Game actual;
    Card c;

    public StateAdapter(Game g) {
        this.actual = g;
    }

    public Game getGame() {
        return actual;
    }

    @Override
    public State config(int nPlayers, ArrayList<JTextField> pNames) {
        return this;
    }

    @Override
    public State start() {
        return this;
    }

    @Override
    public State bet(int coins, Player p) {
        return this;
    }

    public State buy(int n) {
        return this;
    }

    @Override
    public State chooseAction() {
        return this;
    }

    @Override
    public State choice(Player p, Board b, int i) {
        return this;
    }

    @Override
    public State pick(int num) {
        return this;
    }

    @Override
    public State proxPlayer() {
        
        if (!onEnter()) {
            getGame().nextPlayer();
            return new BuyCard(getGame());
        } else {
            return null;
        }
    }

    @Override
    public State back() {
        return this;
    }

    @Override
    public State chooseArmy(Player p, Board b, int f) {
        return this;
    }

    private boolean onEnter() {
        return getGame().gameFinish();
    }

}
